<template>
  <div>
    <van-nav-bar
      :z-index="999"
      :fixed="true"
      left-arrow
      @click-left="onClickLeft"
      :placeholder="true"
      title="点评"
    ></van-nav-bar>
    <!-- <div class="allEstimate">
      <div>全部(43)</div>
      <div>好评(41)</div>
      <div>中评(20)</div>
      <div>差评(1)</div>
      <div>可图点评(4)</div>
      <div>服务热情(4)</div>
      <div>教训耐心(4)</div>
      <div>环境优雅(20)</div>
      <div>收费合理(21)</div>
    </div>-->
    <div v-for="(item, index) in comments" :key="index">
      <van-cell class="nBss-cell top-border">
        <template #icon>
          <div class="nb-avatar">
            <img :src="item.img" alt />
          </div>
        </template>
        <template>
          <div class="info">
            <div class="author">{{ item.name }}</div>
            <div class="comment-attr">
              <div class="postTime">{{ item.createTime }}</div>
              <div class="raty-box">
                <van-rate
                  v-model="item.ffzl"
                  readonly
                  void-icon="star"
                  void-color="#eee"
                />
                <span>{{ item.number }}</span>
              </div>
            </div>
          </div>
          <div class="content">
            <div class="text">
              <span>{{ item.remark }}</span>
            </div>
            <div class="bottom-icon">
              <!-- <div class="icon">
                <van-icon name="eye-o" />
                {{item.djl}}
              </div>
              <div class="icon">
                <van-icon name="like-o" />
                {{item.scl}}
              </div>-->
            </div>
          </div>
        </template>
      </van-cell>
    </div>
  </div>
</template>

<script>
import { detalisRemark } from "../../assets/js/api/apply";
export default {
  name: "AllComments",
  data() {
    return {
      comments: []
    };
  },
  mounted() {
    detalisRemark(this.$route.params.lid).then(res => {
      for (let i = 0; i < res.data.jxpjlist.length; i++) {
        res.data.jxpjlist[i].ffzl = Number(res.data.jxpjlist[i].ffzl);
      }
      this.comments = res.data.jxpjlist;
      console.log(this.comments);
    });
  },
  methods: {
    onClickLeft() {
      this.$router.go(-1);
    }
  },
  created() {
    let dsBridge = require("dsbridge");
    dsBridge.call("goBack", "", function() {
      history.go(-1);
    });
  }
};
</script>

<style></style>
